Skip to content

Auto-update schema cache#19

Merged
kfrey-idm merged 1 commit intoEMOD-Hub:mainfrom
kfrey-idm:zdu_s2c
Sep 24, 2025
Merged

Auto-update schema cache#19
kfrey-idm merged 1 commit intoEMOD-Hub:mainfrom
kfrey-idm:zdu_s2c

Conversation

@kfrey-idm
Copy link
Member

@ZDu-IDM (I can't tag him because he's not a member of EMOD-Hub) ran into the same schema caching issue I was struggling with earlier: https://github.com/InstituteforDiseaseModeling/emod-api-old/pull/800

His solution is better, and I'd like to apply it here.

The idea is to cache both the contents of the schema and the file name of the schema, and auto-update the contents if-and-only-if the file name changes. Good stuff.

Also note that passing schema-as-json directly remains the preferred route. Wherever possible, have whatever is calling the function get_class_with_defaults manage the file I/O.

@kfrey-idm kfrey-idm self-assigned this Sep 23, 2025
@kfrey-idm kfrey-idm added the enhancement New feature or request label Sep 23, 2025
Copy link
Collaborator

@stitova-idm stitova-idm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should remove schema-path parameter altogether. It doesn't make sense to keep this backwards compatible. Emodpy-malaria is using emod-api 1.x and I don't think there are plans to move the project to emod-api 2.0 while keeping everything at 1.0???

@kfrey-idm
Copy link
Member Author

I think we should remove schema-path parameter altogether. It doesn't make sense to keep this backwards compatible. Emodpy-malaria is using emod-api 1.x and I don't think there are plans to move the project to emod-api 2.0 while keeping everything at 1.0???

I agree, but it'll still need a bunch of other changes (and other PRs). I've made a tracking ticket here EMOD-Hub/issues-and-discussions#100

@kfrey-idm kfrey-idm merged commit e355aa1 into EMOD-Hub:main Sep 24, 2025
3 checks passed
@kfrey-idm kfrey-idm deleted the zdu_s2c branch September 24, 2025 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants